package com.ezops.controller;

import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.servlet.ModelAndView;

import com.ezops.exception.EzopsUIException;

@ControllerAdvice
public class EzopsUIExceptionController {
	@ExceptionHandler(EzopsUIException.class)
	public ModelAndView handleCustomException(EzopsUIException ex) {
		ModelAndView model = new ModelAndView();
		model.addObject("message", ex.getMessage());
		return model;

	}

	@ExceptionHandler(Exception.class)
	public ModelAndView handleAllException(Exception ex) {
		ModelAndView model = new ModelAndView();
		return model;

	}
}
